SUBROUTINE FCN (NPARS,VECPAR,FOU)
USE SHARE
IMPLICIT NONE
DOUBLE PRECISION, DIMENSION(900) :: den
INTEGER :: i,j,NPARS,jp
DOUBLE PRECISION:: wt(5000),VECPAR(NPARS),FOU
! PRINT 657, NMOS,gamma,(vecpar(j),j=1,npars); 657 format (' in fcn NMOS ',i6,' gamma ',f5.2,' vecpar ',6(f10.7,1x))
DO i=1, NMOS   !  compute the summation parts of denominator
   den(i)=zero
   DO j=1, ktr(i)
         sc=zero
         DO jp=1,NPARS
            sc=sc+(vecpar(jp)*chars(j,i,jp))
         END DO
         wt(j)= weig(j,i)+ sc/ktr(i)
         den(i)=den(i)+wt(j)*rit(j,i)
   END DO
   ISOPRT(i)=den(i)
END DO
FOU=zero
DO i=1,NMOS
   FOU = FOU -((one+den(i))**(one-gamma))/(one-gamma)
END DO
FOU=FOU/NMOS
RETURN; END
